<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf8"/>
    <title>WordProcessingML Support Module Functions - MarkLogic Server Online Documentation</title>
    <meta name="Homepage" content="server, administration, Mark Logic, xml, xquery, database"/>
    <meta name="Keywords" content="server, administration, Mark Logic, xml, xquery, database"/>
    <meta name="Description" content="WordProcessingML Support Module Functions - MarkLogic Server Online Documentation"/>
    <link href="images/admin.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
<form name="apidocs" action="apidocs.xqy" method="GET">
      <input type="hidden" name="fname" value="WordProcessingML Support"/>
      <table height="400" cellspacing="0" cellpadding="0" width="100%" border="0">
   <tr>
	 
	  <td valign="top" class="mainbody">
  <table cellspacing="0" cellpadding="0" border="0" width="100%">
    <tr valign="top" style="background-color: #a0002e">
		<td align="left" height="90" width="100%">
        <div><img src="images/varspace.gif" alt="" height="1" width="178"/></div>
        <div class="host-details" style="padding-left: 20px; padding-top: 10px">
          <div>This page was generated</div>
          <div>December&#160;08,&#160;2009</div>
          <div>5:50&#160;PM</div>
        </div>
      </td>
		<td align="left" width="420" valign="bottom" style="background-image: url(images/top-right-right-background.gif);                   background-repeat: no-repeat">
      <div><img src="images/varspace.gif" alt="" height="1" width="420"/></div>
      <div class="page-name" style="text-align: right; padding-right: 8px;        padding-bottom: 2px">XQuery Function Reference</div>
      </td>
	      </tr>
     <tr valign="top">
		<td colspan="3" align="left" height="100%" width="100%">
     <div><img src="images/varspace.gif" alt="" height="1" width="598"/></div>
  <table width="100%" align="center" cellspacing="1" cellpadding="4">
    <tr valign="top">
		      <td>
      <table width="100%">
      <tr align="center">
			    <td><br/>
      <font size="+1"><b>
      Module: WordProcessingML Support
      </b><br/></font>
      <br/>
      </td>
			  </tr>
 <tr>
			    <td style="font-family:arial;font-size:10pt">

      <p>The WordProcessingML function module is included in the Toolkit for Word zip package as the following 
		  file:</p>
    <ul>
				<li><code><em>zip_dir</em>/xquery/word-processing-ml-support.xqy</code></li>
			      </ul>
    <p>where <code><em>zip_dir</em></code> is the directory in which 
	    the Toolkit for Word was unzipped.</p>
    <p>To use the <code>word-processing-ml-support.xqy</code> module in your own 
    XQuery modules, 
    copy it to your App Server root and include a line similar to the following in your XQuery prolog:</p>
    <pre xml:space="preserve">
import module namespace ooxml="http://marklogic.com/openxml" 
	    at "/word-processing-ml-support.xqy";</pre>
    <p>The WordProcessingML functions are used to manipulate Microsoft Office
    Open XML documents.</p>
  
    </td>
			  </tr>
</table>
</td>
		    </tr>
   
  <tr>
		      <td>
      <table bgcolor="#000000" cellspacing="1" cellpadding="4" width="100%" align="center" class="table-line">
      <tr bgcolor="#f2ebce">
			    <td colspan="10">
          <font size="+1"><b>Function Summary</b></font>
        </td>
			  </tr>

     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:body"><b>
            ooxml:body
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a document body (w:body) element.
          </td>
     </tr>
     <!--<tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:content-types"><b>
            ooxml:content-types
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a default content types element for the .docx package ([Content_Types].xml).
          </td>
     </tr>-->

      <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:create-paragraph"><b>
            ooxml:create-paragraph
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a w:p element 
		  from the specified string.
          </td>
			  </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:create-simple-docx"><b>
            ooxml:create-simple-docx
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a .zip file that is a .docx package containing the minimum parts required to be a valid package. 
          </td>
     </tr>

<tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:custom-xml"><b>
            ooxml:custom-xml
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function tags $content with 
		  w:customXml and sets the @element value
		  to $tag.
          </td>
			  </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:custom-xml-entity-highlight"><b>
            ooxml:custom-xml-entity-highlight
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
                    This function highlights terms in $nodes identified by cts:entity-highlight() 
		  by applying  &lt;w:customXml w:element={$cts:entity-type}&gt;
		  to the term.
          </td>
     </tr>

<tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:custom-xml-highlight"><b>
            ooxml:custom-xml-highlight
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function highlights $hightlight-term in $nodes 
		  by applying &lt;w:customXml w:element={$tag-name}&gt;
		  to the term.
          </td>
			  </tr>
      <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:default-content-types"><b>
            ooxml:default-content-types
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a default content types element for the .docx package ([Content_Types].xml).
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:directory-uris"><b>
            ooxml:directory-uris
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns the URIs for files extracted from .docx package using Open XML Extract pipeline. 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:document"><b>
            ooxml:document
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a document for the .docx package (word/document.xml). 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:document-rels"><b>
            ooxml:document-rels
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
	  This function creates a default document relationships element for a .docx package (word/_rels/document.xml.rels). 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:docx-manifest"><b>
            ooxml:docx-manifest
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function constructs a manifest for the given URIs in the directory. 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:docx-package"><b>
            ooxml:docx-package
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a .zip file that is the .docx package containing the parts passed in as parameters. 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:font-table"><b>
            ooxml:font-table
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a default w:fonts element for a .docx package (word/fontTable.xml). 
          </td>
     </tr>

<tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:get-custom-xml-ancestor"><b>
            ooxml:get-custom-xml-ancestor
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns the greatest ancestor of the 
		  specified node that is either an immediate parent of 
		  type w:customXml or w:sdt, a
		  parent of that parent, and so on until the parent is not
		  a w:customXml or w:sdt
		  element.
          </td>
			  </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:get-directory-package"><b>
            ooxml:get-directory-package           </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns a document in the OPC (Open Packaging Convention) format XML. 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:get-mimetype"><b>
            ooxml:get-mimetype
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns the mimetype for the given URI. 
          </td>
     </tr>

<tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:get-paragraph-style-id"><b>
            ooxml:get-paragraph-style-id
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns the @val attribute for
		  a w:pStyle element (child of
		  w:pPr) from $pstyle.
          </td>
			  </tr><tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:get-paragraph-styles"><b>
            ooxml:get-paragraph-styles
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns the paragraph 
		  properties.
          </td>
			  </tr><tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:get-run-style-id"><b>
            ooxml:get-run-style-id
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns the values for the attribute
		  @val for a w:rStyle element (which is a child 
		  of a w:rPr element).
          </td>
			  </tr><tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:get-run-styles"><b>
            ooxml:get-run-styles
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns paragraph run 
		  styles.
          </td>
			  </tr><tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:get-style-definition"><b>
            ooxml:get-style-definition
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns the style definition from 
		  styles.xml for the given style ID.
          </td>
			  </tr>

     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:list-paragraph-property"><b>
            ooxml:list-paragraph-property
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns a paragraph properties element (w:pPr) for a ListParagraph style identified by id. 
          </td>
     </tr>

     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:numbering"><b>
            ooxml:numbering            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a default w:numbering element for a .docx package (word/numbering.xml). 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:package"><b>
            ooxml:package           </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns a document in the OPC (Open Packaging Convention) format XML. 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:package-files-only"><b>
            ooxml:package-files-only           </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function returns only files for an extracted .docx.
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:package-rels"><b>
            ooxml:package-rels          </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a default package relationships element for the .docx package (_rels/.rels). 
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:paragraph"><b>
            ooxml:paragraph        </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a document paragraph (w:p) element.
          </td>
     </tr>



<tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:remove-paragraph-styles"><b>
            ooxml:remove-paragraph-styles
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function removes all properties from 
		  w:p paragraphs.
          </td>
			  </tr><tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:replace-custom-xml-element"><b>
            ooxml:replace-custom-xml-element
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function replaces any @element values for 
		  w:customXml with $newtag, where 
		  w:customXml[@w:element = $oldtag].
          </td>
			  </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:replace-package-document"><b>
            ooxml:replace-package-document        </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function replaces the document.xml in the specifed OPC document with parameter $document-xml.
          </td>
     </tr>

<tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:replace-paragraph-styles"><b>
            ooxml:replace-paragraph-styles
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function sets paragraph properties for 
		  paragraphs (w:p) within a 
		  block.
          </td>
			  </tr><tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:replace-run-styles"><b>
            ooxml:replace-run-styles
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function sets run properties for 
		  runs (w:r) within a 
		  block.
          </td>
			  </tr><tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:replace-style-definition"><b>
            ooxml:replace-style-definition
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function replaces w:style 
		  elements (style definitions) in w:styles 
		  (the styles.xml file from a .docx package).
          </td>
			  </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:run"><b>
            ooxml:run       </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a run (w:r) element.
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:settings"><b>
            ooxml:settings      </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a default w:settings element for a .docx package (word/settings.xml).
          </td>
     </tr>
 <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:simple-content-types"><b>
            ooxml:simple-content-types
            </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a content types element for a .docx package of minimal parts ([Content_Types].xml).
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:styles"><b>
            ooxml:styles      </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a default w:styles element for a .docx package (word/styles.xml).
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:text"><b>
            ooxml:text      </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates the text element (w:t).
          </td>
     </tr>
     <tr class="mainbody">
			    <td style="font-family: arial; font-size: 10pt;">
          <a href="#ooxml:theme"><b>
            ooxml:theme     </b></a> 
          </td>
			    <td style="font-family: arial; font-size: 10pt;">
          This function creates a default w:theme element for a .docx package (word/themes/theme1.xml).
          </td>
     </tr>



      </table>
      </td>
		    </tr><tr>
		      <td><img src="images/varspace.gif" height="10"/></td>
		    </tr><tr>
		      <td>
      <table bgcolor="#000000" cellspacing="1" cellpadding="4" width="100%" align="right" class="table-line">
      <tr bgcolor="#f2ebce">
			    <td colspan="10">
          <font size="+1"><b>Function Detail</b></font>
        </td>
			  </tr>
      <tr class="mainbody">
			    <td>
       <table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      </td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:body"></a><b><font color="#c00831">
                 ooxml:body</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                       $block-content as element()*
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(w:body)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
	    This function creates a document body element.
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $block-content
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
		 The blockcontent to be populated within the document body.
                 </font>
		 </div> <br/>
	    </td>
				      </tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
  There are two main levels of content in the document.xml; block-level and inline content. Block level describes the structure of the document, and includes paragraphs and tables. Anything that can be a child of <code>w:body</code> may be passed as $block-content.
        </td>
				</tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
          at "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $para := ooxml:create-paragraph("Hello there everyone.")
return ooxml:body($para)
=&gt; 
&lt;w:body xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:p&gt;
     &lt;w:r&gt;&lt;w:t&gt;Hello there everyone.&lt;/w:t&gt;&lt;/w:r&gt;
  &lt;/w:p&gt;
&lt;/w:body&gt;
  </pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

  <table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/> <hr class="control-line" size="1"/>
      </td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:create-paragraph"></a><b><font color="#c00831">
                 ooxml:create-paragraph</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $para as xs:string
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(w:p)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function creates a <code>w:p</code> element 
		  from the specified string.
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $para
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The text of the 
		    paragraph.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
          at "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:create-paragraph("Hello there everyone.")

=&gt; 
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
   &lt;w:r&gt;&lt;w:t&gt;Hello there everyone.&lt;/w:t&gt;&lt;/w:r&gt;
&lt;/w:p&gt;
  
  </pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

  <table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/> <hr class="control-line" size="1"/>
      </td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:create-simple-docx"></a><b><font color="#c00831">
                 ooxml:create-simple-docx</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                     $document as element(w:document)
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;binary()</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
        This function creates a .zip file that is a .docx package containing the minimum parts required to be a valid package.
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $document
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
		 The document <code>(w:document)</code> for the .docx package.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
          at "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $doc := ooxml:document(ooxml:body(ooxml:create-paragraph("Hello, World!")))
return xdmp:zip-manifest(ooxml:create-simple-docx($doc))
=&gt; 
&lt;parts xmlns="xdmp:zip"&gt;
  &lt;part uncompressed-size="375" compressed-size="196" encrypted="false" last-modified="2009-11-24T14:16:14"&gt;[Content_Types].xml&lt;/part&gt;
  &lt;part uncompressed-size="244" compressed-size="139" encrypted="false" last-modified="2009-11-24T14:16:14"&gt;_rels/.rels&lt;/part&gt;
  &lt;part uncompressed-size="150" compressed-size="117" encrypted="false" last-modified="2009-11-24T14:16:14"&gt;word/document.xml&lt;/part&gt;
&lt;/parts&gt;
  </pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>









<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:custom-xml"></a><b><font color="#c00831">
                 ooxml:custom-xml</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $content as element(), 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $tag as xs:string
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(w:customXml)?</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function tags $content with 
		  <code>w:customXml</code> and sets the @element value
		  to $tag.
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $content
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The content 
		    element.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $tag
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The name of the 
		    custom XML tag.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
              The $content parameter must either be an element of type 
	    paragraph (w:p) , run (w:r), field (w:fldSimple,w:fldChar), 
	    hyperlink (w:hyperlink), custom xml (w:customXml), structured 
	    document tag (w:sdt), table (w:tbl), cel (w:tc), or row (w:tr).  
	    If it is not one of these types, the function 
	    returns the empty sequence.
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

let $para:= 
  &lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
       &lt;w:r&gt;&lt;w:t&gt;This is my paragraph.&lt;/w:t&gt;&lt;/w:r&gt;
  &lt;/w:p&gt;
let $tag := "ABCD"
return ooxml:custom-xml($para,$tag)
=&gt;
&lt;w:customXml w:element="ABCD" 
  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:p&gt;&lt;w:r&gt;&lt;w:t&gt;This is my paragraph.&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:p&gt;
&lt;/w:customXml&gt;
</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>




<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:custom-xml-entity-highlight"></a><b><font color="#c00831">
                 ooxml:custom-xml-entity-highlight</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $nodes as node()*, 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;node()*</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
           	 This function highlights terms in $nodes identified by cts:entity-highlight() by applying &lt;w:customXml w:element={$cts:entity-type}&gt;  to the term.  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $nodes
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The paragraph(s) from 
		    which to search for the highlighted terms.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
              
	      This function is a wrapper for cts:entity-highlight, and similar to ooxml:custom-xml-highlight, applies &lt;w:customXml&gt; to terms, adjusting runs (&lt;w:r&gt;) as required.  The nodes passed in as a parameter to the function are intended to be paragraphs (&lt;w:p&gt;). You can of course, embed paragraphs within other elements.
    
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";
declare namespace w= "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $wp := <w:p><w:r><w:t>The MarkLogic government summit was in Washington DC this year.</w:t></w:r></w:p>
return ooxml:custom-xml-entity-highlight($wp)
=&gt;
&lt;w:p&gt;
  &lt;w:r&gt;
    &lt;w:t xml:space="preserve"&gt;The MarkLogic government summit was in &lt;/w:t&gt;
  &lt;/w:r&gt;
  &lt;w:customXml w:element="GPE"&gt;
    &lt;w:r&gt;
      &lt;w:t&gt;Washington DC&lt;/w:t&gt;
    &lt;/w:r&gt;
  &lt;/w:customXml&gt;
  &lt;w:r&gt;
    &lt;w:t xml:space="preserve"&gt; this year.&lt;/w:t&gt;
  &lt;/w:r&gt;
&lt;/w:p&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>



<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:custom-xml-highlight"></a><b><font color="#c00831">
                 ooxml:custom-xml-highlight</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $nodes as node()*, 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $highlight-term as cts:query, 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $tag-name as xs:string, 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      [$attributes as xs:string*], 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      [$values as xs:string*]
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;node()*</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function highlights $hightlight-term in $nodes 
		  by applying &lt;w:customXml w:element={$tag-name}&gt;
		  to the term. It searches for term within 
		  <code>w:t</code> elements within a <code>w:r</code> 
		  (runs), wrapping a customXml element around the element
		  the element containing the highlighted match.
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $nodes
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The paragraph(s) from 
		    which to search for the highlighted terms.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $highlight-term
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The 
		    <code>cts:query</code> used to find the 
		    highlight term.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $tag-name
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The
		    name used for the <code>w:customXml w:element</code> 
		    attribute value.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $attributes
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		    A list of attributes to be added to the
		    <code>w:customXml</code> properties.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $values
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		    The values corresponding to the $attributes.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
              
	    If you specify the $attributes and $values parameters, the length 
	    of the list for each parameter must be the same, otherwise an
	    exception is thrown.
    
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

declare namespace w=
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $wp := &lt;w:p&gt;&lt;w:r&gt;&lt;w:t&gt;THIS IS A TEST!&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:p&gt;
let $wordquery := cts:word-query("TEST")
return  ooxml:custom-xml-highlight($wp,$wordquery,"MYTAG")
=&gt;
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:r&gt;
    &lt;w:t xml:space="preserve"&gt;THIS IS A &lt;/w:t&gt;
  &lt;/w:r&gt;
  &lt;w:customXml w:element="MYTAG"&gt;
   &lt;w:r&gt;
     &lt;w:t&gt;TEST&lt;/w:t&gt;
   &lt;/w:r&gt;
  &lt;/w:customXml&gt;
  &lt;w:r&gt;
    &lt;w:t xml:space="preserve"&gt;!&lt;/w:t&gt;
  &lt;/w:r&gt;
&lt;/w:p&gt;
  
</pre>
  
            </div>
            </td>
				</tr><tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

declare namespace w=
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $wp := &lt;w:p&gt;&lt;w:r&gt;&lt;w:t&gt;THIS IS A TEST!&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:p&gt;
let $wordquery := cts:word-query("TEST")
let $attributes := ("author","id")
let $values := ("oslo","1") 
return  ooxml:custom-xml-highlight($wp,$wordquery,"MYTAG", $attributes, $values)
=&gt;
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:r&gt;
    &lt;w:t xml:space="preserve"&gt;THIS IS A &lt;/w:t&gt;
  &lt;/w:r&gt;
  &lt;w:customXml w:element="MYTAG"&gt;
    &lt;w:customXmlPr&gt;
      &lt;w:attr w:name="author" w:val="oslo"/&gt;
      &lt;w:attr w:name="id" w:val="1"/&gt;
    &lt;/w:customXmlPr&gt;
    &lt;w:r&gt;
      &lt;w:t&gt;TEST&lt;/w:t&gt;
    &lt;/w:r&gt;
  &lt;/w:customXml&gt;
  &lt;w:r&gt;
    &lt;w:t xml:space="preserve"&gt;!&lt;/w:t&gt;
  &lt;/w:r&gt;
&lt;/w:p&gt;
  
</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>







 <table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/> <hr class="control-line" size="1"/>
      </td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:default-content-types"></a><b><font color="#c00831">
                 ooxml:default-content-types</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(types:Types)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
             This function creates a default content types element for the .docx package ([Content_Types].xml).
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;font-size:10pt">
            <br/>
	</td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
	    <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
          at "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:default-content-types()
=&gt; 
&lt;Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"&gt;
  &lt;Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/&gt;
  &lt;Default Extension="xml" ContentType="application/xml"/&gt;
  &lt;Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/&gt;
  &lt;Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/&gt;
  &lt;Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/&gt;
  &lt;Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/&gt;
  &lt;Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/&gt;
  &lt;Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/&gt;
&lt;/Types&gt;
  </pre>
            </div>
            </td>
				</tr>
        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>
<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:directory-uris"></a><b><font color="#c00831">
                 ooxml:directory-uris</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $directory as xs:string, 
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      [$depth as xs:string] 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;xs:string()*</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
           	 This function returns the URIs for files extracted from .docx package using Open XML Extract pipeline.  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $directory
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The name of the directory containing the extracted .docx parts. 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
<table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $depth
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      "1" for immediate children, "infinity" for all. If not supplied, depth is "1".
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:directory-uris("/sampleManuscript_docx_parts/")
=&gt;
/sampleManuscript_docx_parts/[Content_Types].xml
/sampleManuscript_docx_parts/_rels/.rels
/sampleManuscript_docx_parts/customXml/_rels/item1.xml.rels
/sampleManuscript_docx_parts/customXml/item1.xml
/sampleManuscript_docx_parts/customXml/itemProps1.xml
/sampleManuscript_docx_parts/docProps/app.xml
/sampleManuscript_docx_parts/docProps/core.xml
/sampleManuscript_docx_parts/word/_rels/document.xml.rels
/sampleManuscript_docx_parts/word/document.xml
/sampleManuscript_docx_parts/word/fontTable.xml
/sampleManuscript_docx_parts/word/numbering.xml
/sampleManuscript_docx_parts/word/settings.xml
/sampleManuscript_docx_parts/word/styles.xml
/sampleManuscript_docx_parts/word/theme/theme1.xml
/sampleManuscript_docx_parts/word/webSettings.xml
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>
<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:document"></a><b><font color="#c00831">
                 ooxml:document</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $body as element(w:body)? 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(w:document)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
           	 This function creates a document for the .docx package (word/document.xml).  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $body
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                   The body content for the document.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
	    <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $para := ooxml:create-paragraph("Hello, World!")
return ooxml:document(ooxml:body($para))
=&gt;
&lt;w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:body&gt;
    &lt;w:p&gt;
      &lt;w:r&gt;
        &lt;w:t&gt;Hello, World!&lt;/w:t&gt;
      &lt;/w:r&gt;
    &lt;/w:p&gt;
  &lt;/w:body&gt;
&lt;/w:document&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>


<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:document-rels"></a><b><font color="#c00831">
                 ooxml:document-rels</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(pr:Relationships)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
           	 This function creates a default document relationships element for a .docx package (word/_rels/document.xml.rels). 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:document-rels()
=&gt;
&lt;Relationships&gt;
  &lt;Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/&gt;
  &lt;Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/&gt;
  &lt;Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" Target="numbering.xml"/&gt;
  &lt;Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/&gt;
  &lt;Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="fontTable.xml"/&gt;
&lt;/Relationships&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:docx-manifest"></a><b><font color="#c00831">
                 ooxml:docx-manifest</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $directory as xs:string, 
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $uris as xs:string*  
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(zip:parts)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function constructs a manifest for the given URIs in the directory. 
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $directory
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The name of the directory. 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
<table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $uris:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The URIs within the directory to be listed in the manifest. 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $uris := ("/Default_docx_parts/word/document.xml",
              "/Default_docx_parts/[Content_Types].xml",
              "/Default_docx_parts/_rels/.rels")

return ooxml:docx-manifest("/Default_docx_parts/",$uris)
=&gt;
&lt;parts&gt;
  &lt;part&gt;word/document.xml&lt;/part&gt;
  &lt;part&gt;[Content_Types].xml&lt;/part&gt;
  &lt;part&gt;_rels/.rels&lt;/part&gt;
&lt;/parts&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>
<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:docx-package"></a><b><font color="#c00831">
                 ooxml:docx-package</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $content-types as element(types:Types),
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $rels as element(pr:Relationships),
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                        $document as element(w:document),
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                        [$document-rels as element(pr:Relationships)],
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                        [$numbering     as element(w:numbering)],
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                        [$styles as element(w:styles)],
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                        [$settings as element(w:settings)],
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                       [$theme as element(a:theme)],
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                        [$font-table as element(w:fonts)]
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;binary()</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function creates a .zip file that is the .docx package containing the parts passed in as parameters. It <br/>
is assumed the parts are properly mapped to one another.<br/>
Just using the constructors provided its possible to generate a .docx dynamically. <br/><br/>

<i>Some things to remember:  This function either generates: <br/>
1) a simplified .docx with just [Content_Types].xml, .rels, and document.xml. or <br/>
2) a default .docx package that consists of those 3 parts plus any provided additional optional parts.  <br/>
<br/>
The provided ooxml:simple-content-types() returns the [Content_Types].xml for a minimum .docx package.<br/>
ooxml:default-content-types() returns the [Content-Types].xml for a .docx package with all optional parts included.<br/>
These are intended to jumpstart your knowledge of parts required for a .docx package.  Depending on your requirement, you may need<br/>
to update your [Content_Types].xml accordingly.  Also, default constructors have been provided for all optional parts.<br/><br/>

Finally, it is possilbe for a .docx to have more/less parts depending on the information in the document.  This <br/>
function is intended to help get you started with dynamic document generation for a default .docx pacakge. </i>
 
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $content-types
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The [Content_Types].xml part for the .docx package. 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
<tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $rels
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The pacakge relationships part.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
<tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $document
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The document.xml part for the .docx package.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $document-rels
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The document.xml relationships part.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                  $numbering 
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The numbering.xml part for the .docx package. (used for numbered/bulleted lists)
	    
                 </font>
                 </div> 
            </td>
				      </tr>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $styles  
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The styles.xml part for the .docx package.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                    $settings 
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The settings.xml part for the .docx package.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                     $theme
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The theme#.xml part for the .docx package.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                  $font-table
                   <font style="font-size:10pt;font-family:Arial"> 
                       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The fontTable.xml part for the .docx package.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $content-types:= ooxml:simple-content-types()
let $rels := ooxml:package-rels()
let $para := ooxml:create-paragraph("Hello, World!")
let $doc := ooxml:document(ooxml:body($para))
return xdmp:zip-manifest(ooxml:docx-package($content-types, $rels, $doc))
=&gt;
&lt;parts xmlns="xdmp:zip"&gt;
  &lt;part uncompressed-size="375" compressed-size="196" encrypted="false" last-modified="2009-11-25T12:01:28"&gt;[Content_Types].xml&lt;/part&gt;
  &lt;part uncompressed-size="244" compressed-size="139" encrypted="false" last-modified="2009-11-25T12:01:28"&gt;_rels/.rels&lt;/part&gt;
  &lt;part uncompressed-size="160" compressed-size="124" encrypted="false" last-modified="2009-11-25T12:01:28"&gt;word/document.xml&lt;/part&gt;
&lt;/parts&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:font-table"></a><b><font color="#c00831">
                 ooxml:font-table</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(w:fonts)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function creates a default w:fonts element for a .docx package (word/fontTable.xml).  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:font-table()
=&gt;
<i>(Note:following truncated for brevity)</i><br/>
&lt;w:fonts xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:font w:name="Symbol"&gt;
    &lt;w:panose1 w:val="05050102010706020507"/&gt;
    &lt;w:charset w:val="02"/&gt;
    &lt;w:family w:val="roman"/&gt;
    &lt;w:pitch w:val="variable"/&gt;
    &lt;w:sig w:usb0="00000000" w:usb1="10000000" w:usb2="00000000" w:usb3="00000000" w:csb0="80000000" w:csb1="00000000"/&gt;
  &lt;/w:font&gt;
  &lt;w:font w:name="Times New Roman"&gt;
    ...
  &lt;/w:font&gt;
    ...
&lt;/w:fonts&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>




<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:get-custom-xml-ancestor"></a><b><font color="#c00831">
                 ooxml:get-custom-xml-ancestor</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $doc as element()
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element()?</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function returns the greatest ancestor of the 
		  specified node that is either an immediate parent of 
		  type <code>w:customXml</code> or <code>w:sdt</code>, a
		  parent of that parent, and so on until the parent is not
		  a <code>w:customXml</code> or <code>w:sdt</code>
		  element.  If no such ancestor is found, then the empty 
		  sequence is returned.
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $doc
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 An element to 
		    search.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";
declare namespace w=
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $para:= 
 &lt;w:p&gt;
   &lt;w:r&gt;&lt;w:t&gt;THIS IS A TEST!&lt;/w:t&gt;&lt;/w:r&gt;
 &lt;/w:p&gt;
let $custom := 
  &lt;w:customXml w:element="foo"&gt;
    &lt;w:customXml w:element="bar"&gt;{$para}&lt;/w:customXml&gt;
  &lt;/w:customXml&gt;
let $wp1 := $custom//w:p
return  ooxml:get-custom-xml-ancestor($wp1)
=&gt;
&lt;w:customXml w:element="foo" 
  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
 &lt;w:customXml w:element="bar"&gt;
	&lt;w:p&gt;&lt;w:r&gt;&lt;w:t&gt;THIS IS A TEST!&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:p&gt;
 &lt;/w:customXml&gt;
&lt;/w:customXml&gt;
  </pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>



<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:get-directory-package"></a><b><font color="#c00831">
                 ooxml:get-directory-package</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $directory as xs:string
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(pkg:package)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
          This function returns a document in the OPC (Open Packaging Convention) format XML. 
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                    $directory: 
                   
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The directory containing the extracted parts for a .docx package
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial; font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:get-directory-package("/sampleManuscript_docx_parts/")
=&gt;
&lt;pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage"&gt;
  &lt;pkg:part pkg:name="/_rels/.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="512"&gt;
    &lt;pkg:xmlData&gt;
      &lt;Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"&gt;
        ...
      &lt;/Relationships&gt;
    &lt;/pkg:xmlData&gt;
  &lt;/pkg:part&gt;
  &lt;pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"&gt;
    &lt;pkg:xmlData&gt;
      &lt;w:document&gt;
        &lt;w:body&gt;
           &lt;w:p&gt; ... &lt;/w:p&gt;
        &lt;/w:body&gt;
      &lt;/w:document&gt;
    &lt;/pkg:xmlData&gt;
  &lt;/pkg:part&gt;
    ...
&lt;pkg:package&gt;
</pre>
</div>

<div style="margin-left:.5in; margin-right:8px; font-family:arial; font-size:10pt">
<i>Note: example above truncated for brevity. All pieces of .docx package are present and serialized <br/>
within &lt;pkg:package&gt;, captured as &lt;pkg:part&gt; elements.<br/><br/>
Images in this format are captured as base64 encoded strings, following the Open XML format. This <br/>
file may be opened as a .XML file within Word. Saving as XML in Word will generate this format <br/>
for a .docx package as well.
</i>
       
	    </div>
       </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>


<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:get-mimetype"></a><b><font color="#c00831">
                 ooxml:get-mimetype</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $filename as xs:string 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;xs:string?</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function returns the mimetype for the given URI. 
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $uri  
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 URI reference 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:get-mimetype("/sampleManuscript.docx")
=&gt;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>



<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:get-paragraph-style-id"></a><b><font color="#c00831">
                 ooxml:get-paragraph-style-id</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $pstyle as element(w:pPr)
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;xs:string?</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function returns the @val attribute for
		  a <code>w:pStyle</code> element (child of
		  <code>w:pPr</code>) from $pstyle. Returns the empty sequence
		  if no IDs are found.
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $pstyle
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The 
		    <code>w:pPr</code> element.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

declare namespace w=
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $pstyle:= 
       &lt;w:pPr&gt;
             &lt;w:pStyle w:val="TestParagraphStyle" /&gt;
             &lt;w:ind w:left="1440" /&gt;
        &lt;/w:pPr&gt;
return ooxml:get-paragraph-style-id($pstyle)

=&gt; TestParagraphStyle
</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
        </table><table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:get-paragraph-styles"></a><b><font color="#c00831">
                 ooxml:get-paragraph-styles</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $paragraph as element(w:p)*
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(w:pPr)*</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function returns the paragraph 
		  properties.  Returns the empty sequence
		  if no styles are found.
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $paragraph
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The w:p 
		    element(s).
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

let $wp := 
&lt;w:p  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:pPr&gt;&lt;w:u/&gt;&lt;/w:pPr&gt;
  &lt;w:r&gt;&lt;w:t&gt;This is a test.&lt;/w:t&gt;&lt;/w:r&gt;
&lt;/w:p&gt;
return ooxml:get-paragraph-styles($wp)
=&gt;
&lt;w:pPr xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
	&lt;w:u/&gt;
&lt;/w:pPr&gt;
  </pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
        </table><table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:get-run-style-id"></a><b><font color="#c00831">
                 ooxml:get-run-style-id</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $rstyle as element(w:rPr)
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;xs:string?</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function returns the values for the attribute
		  @val for a <code>w:rStyle</code> element (which is a child 
		  of a <code>w:rPr</code> element). Returns the empty sequence
		  if no IDs are found.
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $rstyle
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The 
		    <code>w:rPr</code> element 
		    containing the <code>w:rStyle</code> element.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

let $rstyle := 
&lt;w:rPr xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
        &lt;w:rStyle w:val="oslo"/&gt;&lt;w:u/&gt;
&lt;/w:rPr&gt;
return ooxml:get-run-style-id($rstyle)
=&gt;
oslo
</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
        </table><table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:get-run-styles"></a><b><font color="#c00831">
                 ooxml:get-run-styles</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $paragraph as element(w:p)*
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(w:rPr)*</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function returns paragraph run 
		  styles. Returns the empty sequence
		  if no styles are found.
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $paragraph
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The w:p 
		    element(s).
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";


let $wp := 
&lt;w:p  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:pPr&gt;&lt;w:u/&gt;&lt;/w:pPr&gt;
  &lt;w:r&gt;
      &lt;w:rPr&gt;&lt;w:b/&gt;&lt;/w:rPr&gt;
      &lt;w:t&gt;This is a test.&lt;/w:t&gt;
   &lt;/w:r&gt;
  &lt;w:r&gt;
      &lt;w:rPr&gt;&lt;w:i/&gt;&lt;/w:rPr&gt;
      &lt;w:t&gt;This is another.&lt;/w:t&gt;
   &lt;/w:r&gt;
&lt;/w:p&gt;
return ooxml:get-run-styles($wp)
=&gt;
&lt;w:rPr xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
	&lt;w:b/&gt;
&lt;/w:rPr&gt;
&lt;w:rPr xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
	&lt;w:i/&gt;
&lt;/w:rPr&gt;

</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
        </table><table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:get-style-definition"></a><b><font color="#c00831">
                 ooxml:get-style-definition</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $styleid as xs:string, 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $styles as element(w:styles)
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(w:style)?</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function returns the style definition from 
		  styles.xml for the given style ID.
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $styleid
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The style ID.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $styles
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The root
	      element from the styles.xml file in the .docx 
	      package.
      
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";
declare namespace w=
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $styleids := "oslo"
let $styles := doc("/Test_docx_parts/word/styles.xml") 
return ooxml:get-style-definitions($styleids, $styles)/w:style
=&gt;
&lt;w:style xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
       	w:type="character" w:customStyle="1" w:styleId="oslo"&gt;
     &lt;w:name w:val="oslo"/&gt;&lt;w:basedOn w:val="Emphasis"/&gt;
     &lt;w:uiPriority w:val="1"/&gt;&lt;w:qFormat/&gt;&lt;w:rsid w:val="005B2E7B"/&gt;
       &lt;w:rPr&gt;&lt;w:rFonts w:ascii="Bodoni MT Black" w:hAnsi="Bodoni MT Black"/&gt;
       &lt;w:b/&gt;&lt;w:sz w:val="32"/&gt;&lt;/w:rPr&gt;
&lt;/w:style&gt;

</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:list-paragraph-property"></a><b><font color="#c00831">
                 ooxml:list-paragraph-property</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $num-id as xs:string 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(w:pPr)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function returns a paragraph properties element (w:pPr) for a ListParagraph style identified by id.  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $num-id
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                  The number id for the ListParagraph style.  1 for bulleted list, 2 for numbering, etc.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
	    <br/>
Bulleted and numbered lists in a Word document, manifest themselves as a sequence of paragraphs (w:p) in the XML.<br/>
To create a numbered list of points from 1-3, you would create 3 paragraphs, and would assign each the returned value from<br/>
list-paragraph-property("2") by setting the paragraph properties accordingly.<br/><br/>
 Even thought each paragraph has a similar style and may look indistinguishable from its sibling paragraphs in the XML, the Office application<br/>
 will manifest each paragraph as starting with 1. , 2. , 3. in the Word document.
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:list-paragraph-property("1")
=&gt;
&lt;w:pPr&gt;
  &lt;w:pStyle w:val="ListParagraph"/&gt;
  &lt;w:numPr&gt;
    &lt;w:ilvl w:val="0"/&gt;
    &lt;w:numId w:val="1"/&gt;
  &lt;/w:numPr&gt;
&lt;/w:pPr&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>
<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:numbering"></a><b><font color="#c00831">
                 ooxml:numbering</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(w:numbering)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function creates a default w:numbering element for a .docx package (word/numbering.xml).  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:numbering()
=&gt;
<i>(Note:following truncated for brevity)</i><br/>
&lt;w:numbering xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
	     xmlns:o="urn:schemas-microsoft-com:office:office"
	     xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
	     xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
	     xmlns:v="urn:schemas-microsoft-com:vml" 
	     xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
	     xmlns:w10="urn:schemas-microsoft-com:office:word"
	     xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" 
             xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"&gt;
  &lt;w:abstractNum w:abstractNumId="0"&gt;
     ...
  &lt;/w:abstractNum&gt;
  &lt;w:abstractNum w:abstractNumId="1"&gt;
     ...
  &lt;/w:abstractNum&gt;
  &lt;w:num w:numId="1"&gt;
    &lt;w:abstractNumId w:val="1"/&gt;
  &lt;/w:num&gt;
  &lt;w:num w:numId="2"&gt;
    &lt;w:abstractNumId w:val="0"/&gt;
  &lt;/w:num&gt;
&lt;/w:numbering&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>


<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:package"></a><b><font color="#c00831">
                 ooxml:package</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $parts as node()*
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(pkg:package)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
          This function returns a document in the OPC (Open Packaging Convention) format XML. 
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                    $parts: 
                   
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The xml parts that together compose a .docx package
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial; font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $directory := "/sampleManuscript_docx_parts/"
let $uris := ooxml:directory-uris($directory)
let $validuris := ooxml:package-files-only($uris)
let $parts := fn:doc(($uris))/node()
return ooxml:package($parts)
=&gt;
&lt;pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage"&gt;
  &lt;pkg:part pkg:name="/_rels/.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="512"&gt;
    &lt;pkg:xmlData&gt;
      &lt;Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"&gt;
        ...
      &lt;/Relationships&gt;
    &lt;/pkg:xmlData&gt;
  &lt;/pkg:part&gt;
  &lt;pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"&gt;
    &lt;pkg:xmlData&gt;
      &lt;w:document&gt;
        &lt;w:body&gt;
           &lt;w:p&gt; ... &lt;/w:p&gt;
        &lt;/w:body&gt;
      &lt;/w:document&gt;
    &lt;/pkg:xmlData&gt;
  &lt;/pkg:part&gt;
    ...
&lt;pkg:package&gt;
</pre>
</div>

<div style="margin-left:.5in; margin-right:8px; font-family:arial; font-size:10pt">
<i>Note: example above truncated for brevity. All pieces of .docx package are present and serialized <br/>
within &lt;pkg:package&gt;, captured as &lt;pkg:part&gt; elements.<br/><br/>
Images in this format are captured as base64 encoded strings, following the Open XML format. This <br/>
file may be opened as a .XML file within Word. Saving as XML in Word will generate this format <br/>
for a .docx package as well.
</i>
       
	    </div>
       </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>
<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:package-files-only"></a><b><font color="#c00831">
                 ooxml:package-files-only</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $uris as xs:string* 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;xs:string*</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function returns only files for an extracted .docx. 
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $uris
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The uris for an extracted .docx package.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $uris := ("/Default_docx_parts/word/document.xml",
              "/Default_docx_parts/[Content_Types].xml",
              "/Default_docx_parts/_rels/.rels",
              "/Default_docx_parts/myCustomParts/")

return ooxml:package-files-only($uris)
=&gt;
/Default_docx_parts/word/document.xml
/Default_docx_parts/[Content_Types].xml
/Default_docx_parts/_rels/.rels
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>
<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:package-rels"></a><b><font color="#c00831">
                 ooxml:package-rels</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(pr:Relationships)
 </td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function creates a default package relationships element for the .docx package (_rels/.rels).  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
            </div>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:package-rels()
=&gt;
&lt;Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"&gt;
  &lt;Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/word/document.xml"/&gt;
&lt;/Relationships&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>
<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:paragraph"></a><b><font color="#c00831">
                 ooxml:paragraph</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $runs as element(w:r), 
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      [$pProps as element(w:pPr)?] 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(w:p)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function creates a document paragraph (w:p) element. 
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $runs
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The runs of text to be included in the paragraph. 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
<table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
		   $pProps
                   <font style="font-size:10pt;font-family:Arial"> 
		       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The properties to be applied to the paragraph.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
	    <br/>The styles referenced in $pProps are assumed to have their definitions defined within the .docx package.<br/><br/>
		 Styles can be defined inline, as well as defined in other .docx package parts <br/> such as styles.xml and numbering.xml.
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:paragraph(ooxml:run(ooxml:text("Hello, World!")))
=&gt;
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:r&gt;
    &lt;w:t xml:space="preserve"&gt;Hello, World!&lt;/w:t&gt;
  &lt;/w:r&gt;
&lt;/w:p&gt;
</pre>
  
            </div>
            </td>
				</tr>
<tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
	    <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
			       "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $styles := ooxml:list-paragraph-property("1")
return ooxml:paragraph((ooxml:run(ooxml:text("Hello, World!"))),$styles)
=&gt;
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:pPr&gt;
    &lt;w:pStyle w:val="ListParagraph"/&gt;
    &lt;w:numPr&gt;
      &lt;w:ilvl w:val="0"/&gt;
      &lt;w:numId w:val="1"/&gt;
    &lt;/w:numPr&gt;
  &lt;/w:pPr&gt;
  &lt;w:r&gt;
    &lt;w:t xml:space="preserve"&gt;Hello, World!&lt;/w:t&gt;
  &lt;/w:r&gt;
&lt;/w:p&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:remove-paragraph-styles"></a><b><font color="#c00831">
                 ooxml:remove-paragraph-styles</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $paragraph as element()
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element()</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function removes all properties from 
		  <code>w:p</code> paragraphs. Paragraph properties are 
		  <code>w:pPr</code> elements and run properties are 
		  <code>w:rPr</code> elements.
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $paragraph
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 Any block-level
	    element.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
              This function is useful when you want to insert a 
	    paragraph with the Office defaults, or when you want to 
	    switch the existing properties for a paragraph.
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

let $paragraph:=
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:pPr&gt;&lt;w:b/&gt;&lt;/w:pPr&gt;
     &lt;w:r&gt;&lt;w:rPr&gt;&lt;w:u/&gt;&lt;/w:rPr&gt;
             &lt;w:t&gt;This is a test.&lt;/w:t&gt;
      &lt;/w:r&gt;&lt;/w:p&gt;
return ooxml:remove-paragraph-styles($paragraph)
=&gt;
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
	&lt;w:r&gt;&lt;w:t&gt;This is a test.&lt;/w:t&gt;&lt;/w:r&gt;
&lt;/w:p&gt;

</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
        </table><table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:replace-custom-xml-element"></a><b><font color="#c00831">
                 ooxml:replace-custom-xml-element</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $content as element(), 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $oldtag as xs:string, 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $newtag as xs:string
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element()</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function replaces any @element values for 
		  <code>w:customXml</code> with $newtag, where 
		  <code>w:customXml[@w:element = $oldtag]</code>.
	  
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $content
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The OOXML 
		    content.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $oldtag
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The old tag for the 
	      element name.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $newtag
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The new tag for the 
	      element name.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

declare namespace w=
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $block:=
&lt;w:customXml w:element="ABCD"&gt;
    &lt;w:p&gt;
&lt;w:r&gt;&lt;w:t&gt;This is my paragraph.&lt;/w:t&gt;&lt;/w:r&gt;
         &lt;/w:p&gt;
&lt;/w:customXml&gt;
let $origtag := "ABCD"
let $newtag := "EFGH"
return ooxml:replace-custom-xml-element($block,$origtag,$newtag)
=&gt;
&lt;w:customXml w:element="EFGH" 
  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:p&gt;&lt;w:r&gt;&lt;w:t&gt;This is my paragraph.&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:p&gt;
&lt;/w:customXml&gt;
</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:replace-package-document"></a><b><font color="#c00831">
                 ooxml:replace-package-document</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                       $pkg-xml as element(pkg:package), 
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $document-xml as element(w:document) 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(pkg:package)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
This function replaces the document.xml in the specifed OPC document with parameter $document-xml. 
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $pkg-xml:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The .docx package in Flat OPC format.  It is the .docx serialized as a single &tl;pkg:package&gt;.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
<table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $document-xml:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The document.xml (&lt;w:document&gt;) for a .docx package.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
	    <br/>
This function is intended to help facilitate managment of .docx documents and subdocuments in the Open XML Flat OPC format.<br/><br/>
Think of the OPC format as a container.  It contains all the parts for a valid .docx package. <br/> You can open a file serialized in the OPC format as a Word document within Word.  Also, if you<br/>
 were to save a Word document as .xml instead of .docx you can see it is serialized in the OPC format.<br/><br/>

While you can open and save a document in OPC format as a complete document, you can also insert this XML into<br/>
an active Word document using the Toolkit javascript API (MLA.insertXML()).  When you use this function, the entire <br/>
document inserts at the current cursor location, but the document body children elements insert and become additional <br/>
paragraphs, tables, bulleted lists, etc. within the document being authored. The document inserted does NOT replace<br/>
the document being authored.  Used in this way, the OPC format 
provides a container for managing the document parts<br/> you'd like to insert into an active Word document.<br/><br/>

Because the OPC document contains the styles and associated parts required by the document.xml, when inserted into another<br/>
 document, required styles and references are appended to the appropriate XML parts in the .docx being authored.<br/><br/>

To investigate more, the javascript Toolkit API also provides functions for extracting the WordOpenXML property (MLA.getContentControlWordOpenXML()) <br/>
for Content Controls.  The XML returned by this function returns the contents of the Control as if it were the only <br/>
content in its own .docx package.<br/><br/>


	    </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

let $directory:="/sampleManuscript_docx_parts/" 
let $uris := ooxml:directory-uris($directory)
let $pkg := ooxml:package($directory, $uris)

let $text := ooxml:text("Hello, ")
let $text2 := ooxml:text("World!")
let $run := ooxml:run(($text,$text2))
let $para := ooxml:paragraph($run)
let $body := ooxml:body($para)
let $document := ooxml:document($body)

return ooxml:replace-package-document($pkg, $document)
=&gt;
&lt;pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage"&gt;
    ...
  &lt;pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"&gt;
    &lt;pkg:xmlData&gt;
      &lt;w:document&gt;
        &lt;w:body&gt;
          &lt;w:p&gt;
            &lt;w:r&gt;
              &lt;w:t xml:space="preserve"&gt;Hello, &lt;/w:t&gt;
              &lt;w:t xml:space="preserve"&gt;World!&lt;/w:t&gt;
            &lt;/w:r&gt;
          &lt;/w:p&gt;
        &lt;/w:body&gt;
      &lt;/w:document&gt;
    &lt;/pkg:xmlData&gt;
  &lt;/pkg:part&gt;
    ...
&lt;/pkg:package&gt;
</pre>
  
	    </div>
<div style="margin-left:.5in; margin-right:8px; font-family:arial; font-size:10pt">
<i>Note: example above truncated for brevity. All pieces of .docx package are present and serialized <br/>
within &lt;pkg:package&gt;, captured as &lt;pkg:part&gt; elements.<br/><br/>
Images in this format are captured as base64 encoded strings, following the Open XML format. This <br/>
file may be opened as a .XML file within Word. Saving as XML in Word will generate this format <br/>
for a .docx package as well.
</i>
       
	    </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>



<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:replace-paragraph-styles"></a><b><font color="#c00831">
                 ooxml:replace-paragraph-styles</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $block as element(), 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $wpProps as element(w:pPr)?
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element()</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function sets paragraph properties for 
		  paragraphs (<code>w:p</code>) within a 
		  block.  If the empty sequence is passed for $wpProps, then
		  the paragraph properties for the $block are
		  removed.
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $block
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The block containing 
		    the paragraph to be updated.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $wpProps
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The paragraph
		    properties, as a w:pPr element, to be applied within the
		    paragraph block. 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
              
	    <p>If $block already has styles applied, these styles are replaced 
		    by the new style parameters.  If the empty sequence is 
		    passed for $wpProps, the paragraph properties for the 
		    $block are removed.  If there are no properties currently 
		    defined for the paragraph, the $wpProps are applied.</p>
	    <p>
	    Note that this function does not validate that the 
	    <code>w:pPr</code> element passed in is valid, so make sure the
	    element you pass in is valid WordProcessingML markup.  If you pass
	    in an invalid element, it could result in a document that
	    cannot be opened in Microsoft Word.
	    </p>
	    
    
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";
declare namespace w=
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $wp1 := 
&lt;w:p&gt;
     &lt;w:r&gt;&lt;w:t&gt;THIS IS A TEST!&lt;/w:t&gt;&lt;/w:r&gt;
&lt;/w:p&gt;
let $pPr := &lt;w:pPr&gt;&lt;w:b/&gt;&lt;/w:pPr&gt;
return  ooxml:replace-paragraph-styles($wp1,$pPr)
=&gt;
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
	&lt;w:pPr&gt;
		&lt;w:b/&gt;
        &lt;/w:pPr&gt;
	&lt;w:t&gt;THIS IS A TEST!&lt;/w:t&gt;
&lt;/w:p&gt;

</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
        </table><table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:replace-run-styles"></a><b><font color="#c00831">
                 ooxml:replace-run-styles</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $block as element(), 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $wrProps as element(w:rPr)?
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element()</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function sets run properties for 
		  runs (<code>w:r</code>) within a 
		  block.  If the empty sequence is passed for $wrProps, then
		  the paragraph properties for the $block are
		  removed.
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $block
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The block containing 
		    the run to be updated.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $wrProps
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The run
		    properties, as a w:rPr element, to be applied within the
		    run block. 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
              
	    Note that this function does not validate that the 
	    <code>w:rPr</code> element passed in is valid, so make sure the
	    element you pass in is valid WordProcessingML markup.  If you pass
	    in an invalid element, it could result in a document that
	    cannot be opened in Microsoft Word.
    
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";
declare namespace w=
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $wp1 := 
&lt;w:p&gt;
     &lt;w:r&gt;&lt;w:t&gt;THIS IS A TEST!&lt;/w:t&gt;&lt;/w:r&gt;
&lt;/w:p&gt;
let $rPr := &lt;w:rPr&gt;&lt;w:b/&gt;&lt;/w:rPr&gt;
return  ooxml:replace-run-styles($wp1,$rPr)
=&gt;
&lt;w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:r&gt;
    &lt;w:rPr&gt;
      &lt;w:b/&gt;
    &lt;/w:rPr&gt;
    &lt;w:t&gt;THIS IS A TEST!&lt;/w:t&gt;
  &lt;/w:r&gt;
&lt;/w:p&gt;	

</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
        </table><table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:replace-style-definition"></a><b><font color="#c00831">
                 ooxml:replace-style-definition</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $newstyle as element(w:style), 
                      </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $styles as element(w:styles)
                      </td>
				      </tr><tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(w:styles)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
            This function replaces <code>w:style</code> 
		  elements (style definitions) in <code>w:styles</code> 
		  (the styles.xml file from a .docx package).
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $newstyle
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The new style
	    element.
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $styles
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The old styles 
	    element (from styles.xml).
                 </font>
                 </div> 
            </td>
				      </tr>
         </table><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            <br/>
              
      <p>If the id for the style $newstyle matches a style definition already 
	      present in $styles, the $newstyle will replace the existing 
	      style.</p>
      <p>If the id for the style $newstyle does not exist in $styles, the 
	      $newstyle definition will be appended to the other 
	      definitions in $styles.</p>
      <p>Note that it is possible within Microsoft Word to create styles 
	      with names that differ only in their case that have different 
	      style attributes. For example,
	      you can create two styles: "mystyle" and "MYSTYLE", which
	      have completely different style definitions.</p>
	    
    
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
		  at "MarkLogic/openxml/word-processing-ml-support.xqy";

let $oldstyle := 
 &lt;w:styles 
  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:style w:type="character" w:customStyle="1" w:styleId="oslo"&gt;
     &lt;w:name w:val="oslo"/&gt;&lt;w:basedOn w:val="Emphasis"/&gt;
     &lt;w:uiPriority w:val="1"/&gt;&lt;w:qFormat/&gt;&lt;w:rsid w:val="005B2E7B"/&gt;
       &lt;w:rPr&gt;&lt;w:rFonts w:ascii="Bodoni MT Black" w:hAnsi="Bodoni MT Black"/&gt;
       &lt;w:b/&gt;&lt;w:sz w:val="32"/&gt;&lt;/w:rPr&gt;
   &lt;/w:style&gt;
 &lt;/w:styles&gt;
let $newstyle :=
  &lt;w:style 
   xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
   w:type="character" w:customStyle="1" w:styleId="oslo"&gt;
     &lt;w:name w:val="oslo"/&gt;&lt;w:basedOn w:val="Emphasis"/&gt;
     &lt;w:uiPriority w:val="1"/&gt;&lt;w:qFormat/&gt;&lt;w:rsid w:val="005B2E7B"/&gt;
       &lt;w:rPr&gt;&lt;w:rFonts w:ascii="Courier New" w:hAnsi="Courier New"/&gt;
       &lt;w:b/&gt;&lt;w:sz w:val="32"/&gt;&lt;/w:rPr&gt;
   &lt;/w:style&gt;
return
ooxml:replace-style-definition($newstyle, $oldstyle)
=&gt;
&lt;w:styles 
  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:style w:type="character" w:customStyle="1" w:styleId="oslo"&gt;
    &lt;w:name w:val="oslo"/&gt;&lt;w:basedOn w:val="Emphasis"/&gt;
    &lt;w:uiPriority w:val="1"/&gt;&lt;w:qFormat/&gt;&lt;w:rsid w:val="005B2E7B"/&gt;
    &lt;w:rPr&gt;&lt;w:rFonts w:ascii="Courier New" w:hAnsi="Courier New"/&gt;
      &lt;w:b/&gt;
      &lt;w:sz w:val="32"/&gt;
    &lt;/w:rPr&gt;
  &lt;/w:style&gt;
&lt;/w:styles&gt;
</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
			</table>



<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:run"></a><b><font color="#c00831">
                 ooxml:run</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      $text as element(w:t)*, 
                      </td>
				      </tr>
<tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                      [$rProps as element(w:rPr)?] 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(w:r)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function creates a run (w:r) element.  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $text
                   :
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The text elements to be included in the run. 
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
<table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
		   $rProps
                   <font style="font-size:10pt;font-family:Arial"> 
		       (optional)</font>:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 
		      The properties to be applied to the run.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
	    <br/>The styles referenced in $rProps are assumed to have their definitions defined within the .docx package.<br/><br/>
		 Styles can be defined inline, as well as defined in other .docx package parts <br/> such as styles.xml and numbering.xml.
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:run(ooxml:text("Hello, World!"))
=&gt;
&lt;w:r xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:t xml:space="preserve"&gt;Hello, World!&lt;/w:t&gt;
&lt;/w:r&gt;
</pre>
  
            </div>
            </td>
				</tr>
<tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

declare namespace w= "http://schemas.openxmlformats.org/wordprocessingml/2006/main";

let $bold := &lt;w:rPr&gt;&lt;w:b/&gt;&lt;/w:rPr&gt;
return ooxml:run((ooxml:text("Hello, World!")),$bold)
=&gt;
&lt;w:r xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  &lt;w:rPr&gt;
    &lt;w:b/&gt;
  &lt;/w:rPr&gt;
  &lt;w:t xml:space="preserve"&gt;Hello, World!&lt;/w:t&gt;
&lt;/w:r&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
			</table>


<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:settings"></a><b><font color="#c00831">
                 ooxml:settings</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(w:settings)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function creates a default w:settings element for a .docx package (word/settings.xml).  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:settings()
=&gt;
&lt;w:settings xmlns:o="urn:schemas-microsoft-com:office:office"
	    xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" 
            xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" 
            xmlns:v="urn:schemas-microsoft-com:vml" 
            xmlns:w10="urn:schemas-microsoft-com:office:word" 
            xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" 
            xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main"/&gt;
&lt;w:zoom w:percent="100"/&gt;
&lt;w:proofState w:spelling="clean" w:grammar="clean"/&gt;
&lt;w:defaultTabStop w:val="720"/&gt;
&lt;w:characterSpacingControl w:val="doNotCompress"/&gt;
  &lt;w:compat&gt;
    &lt;w:useFELayout/&gt;
  &lt;/w:compat&gt;
  &lt;w:rsids&gt;
    &lt;w:rsidRoot w:val="003D2A77"/&gt;
    &lt;w:rsid w:val="002A2DDE"/&gt;
    &lt;w:rsid w:val="00397362"/&gt;
    &lt;w:rsid w:val="003D2A77"/&gt;
  &lt;/w:rsids&gt;
  &lt;m:mathPr&gt;
    &lt;m:mathFont m:val="Cambria Math"/&gt;
    &lt;m:brkBin m:val="before"/&gt;
    &lt;m:brkBinSub m:val="--"/&gt;
    &lt;m:smallFrac m:val="off"/&gt;
    &lt;m:dispDef/&gt;
    &lt;m:lMargin m:val="0"/&gt;
    &lt;m:rMargin m:val="0"/&gt;
    &lt;m:defJc m:val="centerGroup"/&gt;
    &lt;m:wrapIndent m:val="1440"/&gt;
    &lt;m:intLim m:val="subSup"/&gt;
    &lt;m:naryLim m:val="undOvr"/&gt;
  &lt;/m:mathPr&gt;
  &lt;w:themeFontLang w:val="en-US"/&gt;
  &lt;w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2" w:accent3="accent3" w:accent4="accent4" w:accent5="accent5" w:accent6="accent6" w:hyperlink="hyperlink" w:followedHyperlink="followedHyperlink"/&gt;
  &lt;w:shapeDefaults&gt;
  &lt;o:shapedefaults v:ext="edit" spidmax="3074"/&gt;
    &lt;o:shapelayout v:ext="edit"&gt;
      &lt;o:idmap v:ext="edit" data="1"/&gt;
    &lt;/o:shapelayout&gt;
  &lt;/w:shapeDefaults&gt;
  &lt;w:decimalSymbol w:val="."/&gt;
  &lt;w:listSeparator w:val=","/&gt;
&lt;/w:settings&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

  <table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/> <hr class="control-line" size="1"/>
      </td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:simple-content-types"></a><b><font color="#c00831">
                 ooxml:simple-content-types</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160; as &#160;element(types:Types)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
             This function creates a content types element for a .docx package of minimal parts ([Content_Types].xml).
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;font-size:10pt">
            <br/>
  The minimum .docx package includes: [Content_Types].xml, _rels/.rels, word/document.xml <br/><br/>
	</td>
				</tr>
 
 <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
	    <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" 
          at "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:simple-content-types()
=&gt; 
&lt;Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"&gt;
  &lt;Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/&gt;
  &lt;Default Extension="xml" ContentType="application/xml"/&gt;
  &lt;Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/&gt;
&lt;/Types&gt;
  </pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
	</table>

<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:styles"></a><b><font color="#c00831">
                 ooxml:styles</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(w:styles)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
This function creates a default w:styles element for a .docx package (word/styles.xml).  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:styles()
=&gt;
<i>(Note:following truncated for brevity)</i><br/>
&lt;w:styles&gt;
  &lt;w:docDefaults&gt;
     ...
  &lt;/w:docDefaults&gt;
  &lt;w:latentStyles w:defLockedState="0" w:defUIPriority="99" w:defSemiHidden="1" w:defUnhideWhenUsed="1" w:defQFormat="0" w:count="267"&gt;
     ...
  &lt;/w:latentStyles&gt;
  &lt;w:style w:type="paragraph" w:default="1" w:styleId="Normal"&gt;
     ...
  &lt;/w:style&gt;
  &lt;w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont"&gt;
     ...
  &lt;/w:style&gt;
     ...
&lt;/w:styles&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
			</table>
			<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:text"></a><b><font color="#c00831">
                 ooxml:text</font></b>(
                    </td>
				      </tr><tr>
					<td width="20"></td>
					<td style="font-size:11pt;font-family:Courier">
                     $text as xs:string? 
                      </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(w:t)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>

This function creates a run (w:r) element.  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
      <table>
          <tr class="mainbody">
					<td style="font-size:11pt;font-family:Arial">
               <img src="images/varspace.gif" width="8"/>
                 <div style="margin-left:.5in; margin-right:8px">
                 <font style="font-size:11pt;font-family:Courier">
                   $text:
                 </font>
                 <font style="font-family:arial;font-size:10pt">
                 The string to be included in the text (w:t) element.
	    
                 </font>
                 </div> 
            </td>
				      </tr>
	 </table>
         <br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
	    <br/>
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:text("Hello, World!")
=&gt;
  &lt;w:t xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xml:space="preserve"&gt;Hello, World!&lt;/w:t&gt;
</pre>
  
            </div>
            </td>
				</tr>

        <tr class="mainbody">
				  <td></td>
				</tr>
			</table>

<table border="0" width="100%" class="mainbody" cellspacing="0" cellpadding="0">

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/>
      <hr class="control-line" size="1"/></td>
				</tr>

        <tr class="mainbody">
				  <td>

            <table>
            <tr>
					<td colspan="2" style="font-size:12pt;font-family:Courier">
                 <a id="ooxml:theme"></a><b><font color="#c00831">
                 ooxml:theme</font></b>(
                    </td>
				      </tr>
				      <tr>
					<td colspan="2" style="font-size:11pt;font-family:Courier">)&#160;as&#160;element(a:theme)</td>
				      </tr>
            </table>

          </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" height="12"/></td>
				</tr>

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
          <img src="images/varspace.gif" width="8"/>
          <b>Summary:</b>
          <div style="margin-left:.5in; margin-right:8px; font-family:arial;                        font-size:10pt"> <br/>
This function creates a default w:theme element for a .docx package (word/themes/theme1.xml).  
           	 
          </div><br/>
          </td>
				</tr>
        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
    <img src="images/varspace.gif" width="8"/>
    <b>Parameters:</b>
	 <br/><br/>
    </td>
				</tr>
 
        

        <tr class="mainbody">
				  <td style="font-size:10pt;font-family:Arial">
        <img src="images/varspace.gif" width="8"/>
        <b>Usage Notes:</b>
            <div style="margin-left:.5in; margin-right:8px; font-family:arial;                          font-size:10pt">
            </div><br/>
        </td>
				</tr>

        <tr class="mainbody">
				  <td><img src="images/varspace.gif" width="8"/>
            <font style="font-size:10pt;font-family:Arial"><b>Example:</b></font>
            <div style="margin-left:.5in; margin-right:8px; font-size:9pt;                          font-family:Courier"> 
            <pre xml:space="preserve">
xquery version "1.0-ml";
import module namespace ooxml= "http://marklogic.com/openxml" at 
                               "/MarkLogic/openxml/word-processing-ml-support.xqy";

ooxml:theme()
=&gt;
<i>(Note:following truncated for brevity)</i><br/>
&lt;a:theme name="Office Theme" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"&gt;
  &lt;a:themeElements&gt;
    ...
  &lt;/a:themeElements&gt;
  &lt;a:objectDefaults/&gt;
  &lt;a:extraClrSchemeLst/&gt;
&lt;/a:theme&gt;
</pre>
  
            </div>
            </td>
				</tr>


        <tr class="mainbody">
				  <td></td>
				</tr>
			</table>

























       </td>
			  </tr>
      </table>
      </td>
		    </tr>
  </table>
    </td>
	      </tr>
  </table>
  </td>
	</tr>
</table>
      <table cellspacing="0" cellpadding="0" width="100%" align="left" border="0"><tr height="30" valign="middle">
	  <td class="copyright" style="padding-left: 10px">
        &#169; Copyright 2002-2009 Mark Logic Corporation.&#160;&#160;All rights reserved.
      </td>
	</tr></table>
    </form>
</body>
</html>
